package com.wyg.iterator;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * @description:
 * @author: WYG
 * @time: 2021/4/6 9:07
 */

public class PancakeHouseMenu {
    private ArrayList<MenuItem> menuItems;

    public PancakeHouseMenu() {
        menuItems = new ArrayList<>();
        addItem("breakfast", "eggs", true, 2.99);
    }

    public void addItem(String name, String description, boolean vegetarian, double price) {
        MenuItem menuItem = new MenuItem(name, description, vegetarian, price);
        menuItems.add(menuItem);
    }

    public Iterator createIterator() {
        return menuItems.iterator();
    }

    @Override
    public String toString() {
        return "PancakeHouseMenu{" +
                "menuItems=" + menuItems +
                '}';
    }
}
